
<?php $detail_form = $this->beginWidget('CActiveForm', array(
		'id'=>'details-form',
		'enableClientValidation'=>true,
	//	'enableAjaxValidation'=>true,
		));
?>
<?php echo CHtml::hiddenField('details_site_ID_field', '0'); ?>
<?php 
function timeList()
{
	$timelist=array();
	for($i=0;$i<48;$i++)
	{
		$time=date('H:i', strtotime('today '.'+'.(30*$i).'minutes'));
		$timelist[$time]=date('h:i a', strtotime('today '.'+'.(30*$i).'minutes'));
	}
	return $timelist;
}
?>
<div id="mysite-head-right">Site Details</div>

<div id="ms-main-contents">

<div align='left' style='color:#FF0000'>
<?php
	echo $detail_form->error($site, 'contact_name');
	echo $detail_form->error($site, 'contact_cell_number');
	echo $detail_form->error($site, 'phone_number_of_site');
	echo $detail_form->error($site, 'after_hour_number');
	echo $detail_form->error($site, 'gate_opens');
	echo $detail_form->error($site, 'gate_closes');
	echo $detail_form->error($site, 'security_code');
	echo $detail_form->error($site, 'open_time');
	echo $detail_form->error($site, 'close_time');
	echo $detail_form->error($site, 'directions');
	echo $detail_form->error($site, 'notes');
?>
</div>
<div id="sd-left">
<div id="sd-left-head">things to let the delivery driver know...</div>

<div id="site-details">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th>Contact Name:</th>
    <td>
    	<div class="textbox3">
    		<?php echo $detail_form->textField($site, 'contact_name', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <th>Contact Cell #:</th>
    <td>
    	<div class="textbox3">
    		<?php echo $detail_form->textField($site, 'contact_cell_number', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <th>Phone # of Site:</th>
    <td>
    	<div class="textbox3">
    		<?php echo $detail_form->textField($site, 'phone_number_of_site', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <th>After Hours #:</th>
    <td>
    	<div class="textbox3">
    		<?php echo $detail_form->textField($site, 'after_hour_number', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th>Gated?</th>
        <td width="95">
        <div class="textbox-sd1">
        	<?php echo $detail_form->dropDownList($site, 'gated', array(1=>'YES', 0=>'NO'), array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED); updateGate(this.options[this.selectedIndex].value);')); ?>
        </div></td>
        <td width="45">Gate opens:</td>
        <td width="65">
        	<div class="textbox-sd2">
        		<?php echo $detail_form->textField($site, 'gate_opens', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
        	</div>
        </td>
        <td width="50">Gate Closes:</td>
        <td width="58">
        	<div class="textbox-sd2">
        		<?php echo $detail_form->textField($site, 'gate_closes', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
        	</div>
        </td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th>Security of Premises?</th>
        <td width="95">
        	<div class="textbox-sd3">
        		<?php echo $detail_form->dropDownList($site, 'security_on_premises', array(1=>'YES', 0=>'NO'), array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED); updateSecurity(this.options[this.selectedIndex].value);')); ?>
        	</div>
        </td>
        <td width="85">Security Code:</td>
        <td>
        	<div class="textbox-sd4">
        		<?php echo $detail_form->textField($site, 'security_code', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
        	</div></td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th>Hours of Operation:</th>
        <td width="45">Opens:</td>
        <td width="80"><div class="textbox-sd2">
        	<?php echo $detail_form->textField($site, 'open_time', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
        </div></td>
        <td width="45">Closes:</td>
        <td><div class="textbox-sd2">
        	<?php echo $detail_form->textField($site, 'close_time', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
        </div></td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <th style="vertical-align:top;">Direction of Driver Inside Site:</th>
    <td class="textbox-sd5">
    	<?php echo $detail_form->textArea($site, 'directions', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
    </td>
  </tr>
</table>

</div><!-- End Site Details -->
</div><!-- End Sd Left -->

<div id="additional">
<div id="add-head">additional notes for delivery:</div>
<div id="add-notes">
	<?php echo $detail_form->textArea($site, 'notes', array('onchange'=>'changeStatus(DOMAIN.DETAIL, STATUS.CHANGED)')); ?>
</div><!-- End Add Notes -->
</div><!-- End Additional -->

<div id="ms-submit">
	<?php echo CHtml::imageButton(Yii::app()->request->baseUrl.'/images/submit5.jpg', array(
										'ajax'=>array(				
											'type'=>'POST',
											'url'=>CController::createUrl('mySites/details'),
											'success'=>'updateDetailsStatus',
											'dataType'=>'json',
										),
									)
								); ?>
</div>
</div><!-- End Ms Main contents -->
<?php $this->endWidget(); ?>